package com.didispace;

import jdk.nashorn.internal.runtime.logging.Logger;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@Log4j2
@SpringBootApplication
public class Chapter1Application {

	public static void main(String[] args) {
		SpringApplication.run(Chapter1Application.class, args);
		new Thread(()->{
			while (true) {
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				log.info(System.currentTimeMillis()+"运行日志");
			}
		}, "info-log").start();
		new Thread(()->{
			while (true) {
				try {
					Thread.sleep(10000);
					throw new InterruptedException();
				} catch (InterruptedException e) {
					e.printStackTrace();
					log.error(System.currentTimeMillis()+"异常日志");
				}

			}
		}, "err-log").start();
	}

}
